﻿using System;
using System.Data;
using System.Collections;
using System.Configuration;
using MJHDataService;

/// <summary>
/// Summary description for AppRole
/// </summary>
public class AppRole : IDisposable
{
    private bool disposed = false;
    private SqlDataService oSvc;

    public AppRole()
    {
        oSvc = new SqlDataService(ConfigurationManager.ConnectionStrings["NuTraxDB"].ConnectionString);
    }

    #region IDisposable Members

    private void Dispose(bool disposing)
    {
        if (!disposed)
        {
            if (disposing)
            {
                oSvc.Dispose();
            }
            disposed = true;
        }
    }
    public void Dispose()
    {
        Dispose(true);
        GC.SuppressFinalize(this);
    }
    ~AppRole()
    {
        Dispose(false);
    }

    #endregion

    public DataTable GetAppRoleList()
    {
        return oSvc.ExecuteProcedureReturnDS("AppRole_Read_List", null).Tables[0];
    }
}
